<?php
/**
 * @copyright   Copyright (c) 2017 https://www.sapixx.com All rights reserved.
 * @license     Licensed (http://www.apache.org/licenses/LICENSE-2.0).
 * @author      pillar<ltmn@qq.com>
 * 店铺管理
 */
namespace app\smartbc\validate;
use think\Validate;

class Store extends Validate{

    protected $rule = [
        'id'                => 'require|number',
        'member_miniapp_id' => 'require|number',
        'manage_uid'        => 'require|number',
        'cate_id'           => 'require|number',
        'cate_sid'          => 'require|number',
        'sort'              => 'require|number',
        'name'              => 'require',
        'address'           => 'require',
        'longitude'         => 'require',
        'latitude'          => 'require',
        'telphone'          => 'require',
        'img'               => 'require',
        'imgs'              => 'require|array',
        'mch_id'            => 'require',
    ];
    
    protected $message = [
        'id'                => '编辑ID',
        'member_miniapp_id' => '当前应用APP_ID',
        'manage_uid'        => '好店店长必须填写',
        'sort'              => '必须输入整数',
        'cate_id'           => '行业分类必须选择',
        'cate_sid'          => '二级分类必须选择',
        'name'              => '好店名称必须填写',
        'address'           => '地址必须填写',
        'longitude'         => '位置经度必须填写',
        'latitude'          => '位置纬度必须填写',
        'telphone'          => '联系电话必须填写',
        'img'               => '默认图片必须填写',
        'imgs'              => '展示图片必须上传',
        'mch_id'            => '微信商户号必须填写',
    ];

    protected $scene = [
        'sort'    => ['id', 'sort'],
        'edit'    => ['member_miniapp_id', 'manage_uid', 'cate_id', 'cate_sid', 'name', 'address', 'longitude', 'latitude', 'telphone', 'img', 'imgs','mch_id'],
        'reg'     => ['name', 'address','telphone','longitude','latitude'],
    ];
}